package com.gxuwz.restaurant.utils;

import com.gxuwz.restaurant.entity.User;
import com.gxuwz.restaurant.mapper.UserMapper;

import javax.annotation.Resource;
import java.util.List;
import java.util.Random;

public class SaltUtil {

    public  static String getSalt(int n){
        char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()".toCharArray();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            char aChar = chars[new Random().nextInt(chars.length)];
            sb.append(aChar);
        }
        return sb.toString();
    }


}
